Skip to content

12B: Let the queue that holds the notices say where they are - #23

Merged
d4mation merged 1 commit into
mainfrom
12B-notices-queue-option
Aug 20, 2026
Merged

12B: Let the queue that holds the notices say where they are#23
d4mation merged 1 commit into
mainfrom
12B-notices-queue-option

Conversation

@nikolaystrikhar

Copy link
Copy Markdown
Contributor

What: moves option_name() off Notices\Queue and Notices\Store as a public static and onto Notices\Contracts\Queue_Interface as an instance method.

Usage:

$option = Absorber::notices()->option_name();

foreach ( get_site_option( $option, [] ) as $notice ) {
    // Render them yourself.
}

Why this way:

The honest answer depends on which queue the site is running. A static answers for the default implementation whatever is actually bound, so on a site that rebound Queue_Interface to keep notices elsewhere, the snippet in docs/notices.md read an option nothing writes to.

On the contract rather than the default class. The docs invite a host to read the option and render the notices itself, so the object it holds has to be able to answer for itself. Store keeps the composition, since it is the class that owns the option.

Queue::option_name() and Store::option_name() were public static, and public
is earned here -- docs/notices.md tells a host to read the option and render
the notices itself. Static was not: it answers for the default implementation
whatever the site is actually running, so on a site that rebound
Queue_Interface to keep notices elsewhere, the documented snippet read an
option nothing writes to.

It moves onto Queue_Interface as an instance method, so the object a host
holds answers for itself, and the docs ask Absorber::notices() for the name.
Store keeps the composition, since it is the class that owns the option.
Base automatically changed from 12A-conflict-gates to main August 20, 2026 19:20
@d4mation
d4mation merged commit 9111017 into main Aug 20, 2026
5 checks passed
@d4mation
d4mation deleted the 12B-notices-queue-option branch August 20, 2026 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants